<template>
  <!-- 顶部通栏 -->
  <nav>
    <AppTopNav></AppTopNav>
  </nav>
  <!-- 头部组件 -->
  <header>
    <AppHeader></AppHeader>
    <AppHeaderSticky></AppHeaderSticky>
  </header>
  <!-- 二级路由 -->
  <div class="app-body">
    <router-view></router-view>
  </div>
  <!-- 底部组件 -->
  <footer>
    <AppFooter></AppFooter>
  </footer>
</template>

<script>
import AppTopNav from '@/components/AppTopNav.vue'
import AppHeader from '@/components/AppHeader.vue'
import AppFooter from '@/components/AppFooter.vue'
import AppHeaderSticky from '@/components/AppHeaderSticky.vue'
import { useStore } from 'vuex'

export default {
  name: 'MyLayout',
  components: {
    AppTopNav,
    AppHeader,
    AppFooter,
    AppHeaderSticky
  },

  setup () {
    const store = useStore()
    // 获取所有分类数据
    store.dispatch('category/getList')
  }
}
</script>

<style lang='less' scoped>
</style>
